package FamilyAccount;

public class FamilyAccount {

    public static void main(String[] args) {
        boolean isExit = true;
        while (isExit) {
            util.menu();
            char flag = util.read();
            switch (flag) {
                case '1' -> util.showDetails();
                case '2' -> {
                    util.expense(true);
                }
                case '3' -> {
                    util.expense(false);
                }
                case '4' -> {
                    System.out.print("是否确认退出(y/n)");
                    char temp = util.confirm();
                    if (temp == 'y') {
                        isExit = false;
                    }
                }
                default -> System.out.println("错误输入, 请重新输入...");
            }
        }
    }
}
